package com.example.busshop.controller;

import com.example.busshop.common.controller.LogicController;
import com.example.busshop.dao.BusinessDao;
import com.example.busshop.entity.Business;
import com.example.busshop.entity.Shop;
import com.example.busshop.service.BusinessService;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

@RestController
@RequestMapping("/business")
public class BusinessController extends LogicController<BusinessService, BusinessDao, Business,Long> {
    public BusinessController(@Autowired BusinessService businessService) {
        super(businessService);
    }
    @Resource
    BusinessService businessService;
    @GetMapping("/addshop")
    public Shop createShop(@RequestParam Long Id, @RequestParam String name){
        return businessService.createShop(Id,name);
    }
    @GetMapping("/listall")
    public Set<Shop> listAll(@RequestParam Long Id){
        return businessService.allShop(Id);
    }

}
